
$('#btn_login').click(function () {
    var num=$("input[name='num']").val();
    var psw=$("input[name='psw']").val();
    if (check(num,psw)){
        $.post({
            url: '../../requests/admin/login.php',
            data: {'num': num, 'psw': $.md5(psw)},
            async:false,
            success: function (data) {
                if (data == '1') {
                    $$.toast('登录成功');
                    window.location.href='teachers.html';

                }
                else {
                    $$.toast('登录失败');
                }
            }
        });
    }
    else {
        $$.toast("账号或密码不能为空！","warn");
    }
});
function check(num,psw) {
    if (num ==""||psw==""){
        return false;
    }
    else return true;
}